package com.sdl.dagger;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.sdl.dagger.data.Person;
import com.sdl.dagger.di.annotation.Boy;
import com.sdl.dagger.di.annotation.Girl;
import com.sdl.dagger.di.component.DaggerMainActivityComponent;
import com.sdl.dagger.di.module.AndroidModule;
import com.sdl.dagger.di.module.CModule;

import javax.inject.Inject;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    @Inject
    @Girl
    Person girl ;
    @Inject
    @Boy
    Person boy ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        DaggerApplicationComponent.builder()
//                .androidModule(new AndroidModule((DaggerApplication) getApplication()))
//                .build()
//                .inject(this);
//        Toast.makeText(this,""+(boy == girl),Toast.LENGTH_LONG).show();
        DaggerMainActivityComponent.builder()
                .cModule(new CModule())
                .androidModule(new AndroidModule((DaggerApplication)getApplication()))
                .build()
                .inject(this);
        Toast.makeText(this,""+(boy == girl),Toast.LENGTH_LONG).show();
    }
}
